<!DOCTYPE html>
<html>

<head id="Head1">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>开店管家-OEM</title>
    <link href="css/default.css" rel="stylesheet" type="text/css" />
    <link rel="stylesheet" type="text/css" href="js/themes/default/easyui.css" />
    <link rel="shortcut icon" href="images/pos.ico" />
    <link rel="stylesheet" href="css/iconfont1.css">
    <link rel="stylesheet" href="css/lib/loading.css" />
    <link rel="stylesheet" href="css/lib/animetion.css" />
    <link rel="stylesheet" type="text/css" href="js/themes/icon.css" />
    <script type="text/javascript" src="js/jquery-1.4.4.min.js"></script>
    <script src="js/lib/loading.js"></script>
    <script type="text/javascript" src="js/jquery.easyui.min.1.2.2.js"></script>
    <script src="js/lib/vue.min.js"></script>
    <script src="js/lib/vue-resource.js"></script>
    <script src="js/data.js"></script>
    <script src="js/index.js"></script>
    <script src="js/base.js" type="text/javascript" charset="utf-8"></script>
    <style>
        .show {
            width: 450px;
            margin: 0 5px;
            height: 600px;
            border: 1px solid #ccc;
        }
        .show h3 {
            font-size: 25px;
            color: #444;
            text-align: center;
            padding: 0;
            margin: 0;
            background: #e2e9ea;
        }
        .all {
            width: 100%;
            display: flex;
            justify-content: center;
            height: auto;
        }

        .all-1 {
            width: 32%;
            display: flex;
            height: auto;
            flex-direction: column;
            border-radius: 5px;
            text-align: center;
        }

        .all-1-1 {
            width: 100%;
            height: auto;
            display: block;
            text-align: right;
        }

        .all-1-2 {
            position: relative;
            width: 98.5%;
            margin-left: 1px;
            height: auto;
            display: block;
            align-items: center;
            background: #f5f5f5;
            text-align: left;
            padding: 10px 0px;
            border-radius: 5px;
            border: 1px solid #e2e2e2;
        }

        .all-1-2>span {
            padding: 3px 10px;
            color: #1daaf5;
            font-family: 微软雅黑;
        }
        .yuan {
            width: 100%;
            display: flex;
            flex-direction: column;
            margin: 15px 0;
            text-align: right;
            position: relative;
        }
        .yuan-1 {
            height: auto;
            display: flex;
            justify-content: center;
            margin-left: 30%;
        }
        .yuan-1>span {
            font-size: 14px;
            font-family: 微软雅黑;
            padding: 2px 0px 1px 0px;
        }

        .xiao {
            margin-left: 16%;
        }

        .icon-huiyuan {
            position: absolute;
            top: 0px;
            left: 30px;
            font-size: 50px;
            color: blue;
        }

        .icon-jiaoyi {
            position: absolute;
            top: 0px;
            left: 30px;
            font-size: 50px;
            color: #FFB800;
        }

        .icon-shouyi {
            position: absolute;
            top: 0px;
            left: 30px;
            font-size: 50px;
            color: #393D49;
        }

        .icon-you1 {
            position: absolute;
            color: #1daaf5;
            top: 9px;
            right: 30px;
            font-size: 19px;
        }

        .all-1:hover {
            opacity: 0.7;
        }

        .tabless>tr>td {
            padding: 3px;
        }

        .jinru {
            padding: 3px 15px;
            color: #1daaf5;
            list-style: none;
            font-size: 14px;
        }
    </style>
</head>

<body id="box" class="easyui-layout" style="overflow-y:hidden" scroll="no" oncontextmenu=self.event.returnvalue=false>
    <!--修改密码-->
    <div id="mi" style="position:absolute;left:455px;top:100px;width:500px;height:300px;background:#fff;z-index:10000;box-shadow:0px 3px 100px 10px;display:none;">
        <h1 style="text-align: center;">密码修改</h1>
        <a id="guan" style="position: absolute;top:0;right:0" href="#">关闭</a>
        <div style="padding:15px 5px 0px 5px;border:3px solid #ccc;margin-bottom:15px">
            <table class="table table-hover">
                <tbody>
                    <tr>
                        <th colspan="3"></th>
                    </tr>
                    <tr>
                        <td style="width:80px;">
                            手机号码：
                        </td>
                        <td colspan="2">
                            <input id="m1" class="form-control" type="text" style="width:280px;" />
                        </td>
                    </tr>
                    <tr>
                        <td style="width:80px;">验证码：</td>
                        <td>
                            <input id="m2" class="form-control" type="text" style="width:280px;" />
                        </td>
                        <td>
                            <input type="button" id="btn1" class="btn btn-danger" style="display:block;margin:0 auto" value="获取验证码" />
                        </td>
                    </tr>
                    <tr>
                        <td style="width:80px;">新的密码：</td>
                        <td colspan="2">
                            <input id="m3" class="form-control" type="text" style="width:280px;" />
                        </td>
                    </tr>
                    <tr>
                        <td colspan="3">
                            <button id="btn2" class="btn btn-danger" style="display:block;margin:0 auto">确认修改</button>
                        </td>
                    </tr>
                </tbody>
            </table>
        </div>
    </div>
    <noscript>

        <div style=" position:absolute; z-index:100000; height:2046px;top:0px;left:0px; width:100%; background:white; text-align:center;">
            <img src="images/noscript.gif" alt='抱歉，请开启脚本支持！' />
        </div>
    </noscript>
    <div region="north" split="true" border="false" style="overflow: hidden; height:88px;
        background:#007aff repeat-x center 50%;
        line-height: 20px;color: #fff; font-family: Verdana, 微软雅黑,黑体">
        <!--头部背景颜色设置-->
        <span style="display:block;margin-top:30px;margin-left:40px;padding-left:10px; font-size:30px;font-family: Verdana, 微软雅黑,黑体 ">
            <img id="logoimg" src="images/支付.png" width="40" height="40" align="absmiddle" />后台管理中心</span>
        <span style="font-size:16px;padding-right:20px;display:block;margin-left:800px;" class="head">
            <span style="font-size:20px;" id="jibie">
            </span>
            <!-- <span style="font-size:16px;" id="jibie1"> </span>-->欢迎您!
            <span id="user" style="font-size:16px;width:40px;color:rgb(58, 250, 49)"></span>
            <span id="shiming"></span>
            <a style="text-decoration:none;color:#fff;font-size:16px;" href="login.html">[退出]</a>
            <a id="mima" href="#" style="font-size:16px">[密码修改]</a>
        </span>
    </div>
    <div region="south" split="true" style="height: 30px; background: #D2E0F2; ">
        <div class="footer" style="text-align:center;color:#000;">极速支付后台信息管理系统</div>
    </div>
    <div region="west" hide="true" split="true" title="导航菜单" style="width:180px;" id="west">
        <div id="nav" class="easyui-accordion" fit="true" border="false">
            <!--  导航内容 -->
        </div>

    </div>
    <div id="mainPanle" region="center" style="background: #eee; overflow-y:hidden">
        <div id="tabs" class="easyui-tabs" fit="true" border="false">
            <!--首页视图界面-->
            <div title="首页" style="padding:20px;overflow:hidden;">
                <div class="all">
                   <!--  <div class="all-1" style="background: #d9edf7;box-shadow: 0px 0px 8px #d9edf7;">
                        <div class="all-1-1">
                            <div class="yuan">
                                <i class="iconfont icon-huiyuan"></i>
                                <div class="yuan-1" style="margin-left: 40%;">
                                    <table class="tabless" style="color: #3a87ad">
                                        <tr style="opacity: 0;">
                                            <td>总&nbsp;交&nbsp;易&nbsp;额:&nbsp;</td>
                                            <td></td>
                                        </tr>
                                        <tr>
                                            <td>会员总数:&nbsp;</td>
                                            <td id="numberTotalElememts"></td>
                                        </tr>
                                        <tr>
                                            <td>当天新增会员数:&nbsp;</td>
                                            <td id="totalElememts"></td>
                                        </tr>
                                    </table>
                                </div>
                            </div>
                        </div>
                        <div class="all-1-2">
                            <a target="_blank" style="text-decoration:none">
                                <i class="iconfont icon-you1"></i>
                                <span class="jinru">进入会员</span>
                            </a>
                        </div>
                    </div>
                </div> -->
               <!--  <div class="all-1"
                    <div class="all-1-2">
                        <a href="下级会员信息.html" target="_blank" style="text-decoration:none">
                            <i class="iconfont icon-you1"></i>
                            <span class="jinru">进入会员</span>
                        </a>
                    </div>
                </div>
               <!--  <div class="all-1"
                    <!--  <div class="all-1"
                     style="background: #fcf8e3;margin-left: 10px;margin-right: 10px;box-shadow: 0px 0px 8px #fcf8e3;">
                    <div class="all-1-1">
                        <i></i>
                        <div class="yuan">
                            <i class="iconfont icon-jiaoyi"></i>
                            <div class="yuan-1">
                                <table class="tabless" style="margin-left: 20%;color: #c09853;">
                                    <tr>
                                        <td>总&nbsp;交&nbsp;易&nbsp;额:&nbsp;￥&nbsp;</td>
                                        <td id="withdrawSum"></td>
                                    </tr>
                                    <tr>
                                        <td>当前交易额:&nbsp;￥&nbsp;</td>
                                        <td id="RechargeSumD"></td>
                                    </tr>
                                    <tr>
                                        <td>昨日交易额:&nbsp;￥&nbsp;</td>
                                        <td id="RechargeSumY"></td>
                                    </tr>
                                </table>
                            </div>
                        </div>
                    </div>
                    <div class="all-1-2">
                        <a id="jy" target="_blank" style="text-decoration:none">
                            <i class="iconfont icon-you1"></i>
                            <span class="jinru">查询交易</span>
                        </a>
                    </div>
                </div> -->
                    <!--  <div class="all-1" style="background:#f2dede;box-shadow: 0px 0px 8px #f2dede;">
                    <div class="all-1-1">
                        <i></i>
                        <div class="yuan">
                            <i class="iconfont icon-shouyi"></i>
                            <div class="yuan-1">
                                <table class="tabless" style="margin-left: 20%;color: #b94a48;">
                                    <tr>
                                        <td>总收益:&nbsp;￥&nbsp;</td>
                                        <td id="allMoney"></td>
                                    </tr>
                                    <tr>
                                        <td>今日收益:&nbsp;￥&nbsp;</td>
                                        <td id="moneyD"></td>
                                    </tr>
                                    <tr>
                                        <td>昨日收益:&nbsp;￥&nbsp;</td>
                                        <td id="moneyY"></td>
                                    </tr>
                                </table>
                            </div>
                        </div>
                    </div>
                    <div class="all-1-2">
                        <a href="onefenrun.html" target="_blank" style="text-decoration:none">
                            <i class="iconfont icon-you1"></i>
                            <span class="jinru">收益明细</span>
                        </a>
                    </div>
                </div> -->
                </div>
            </div>
        </div>
    </div>

    <!--修改密码窗口-->
    <div id="w" class="easyui-window" title="修改密码" collapsible="false" minimizable="false" maximizable="false" icon="icon-save"
        style="width: 300px; height: 150px; padding: 5px;
        background: #fafafa;">
        <div class="easyui-layout" fit="true">
            <div region="center" border="false" style="padding: 10px; background: #fff; border: 1px solid #ccc;">
                <table cellpadding=3>
                    <tr>
                        <td>新密码：</td>
                        <td>
                            <input id="txtNewPass" type="Password" class="txt01" />
                        </td>
                    </tr>
                    <tr>
                        <td>确认密码：</td>
                        <td>
                            <input id="txtRePass" type="Password" class="txt01" />
                        </td>
                    </tr>
                </table>
            </div>
            <div region="south" border="false" style="text-align: right; height: 30px; line-height: 30px;">
                <a id="btnEp" class="easyui-linkbutton" icon="icon-ok" href="javascript:void(0)">
                    确定</a>
                <a id="btnCancel" class="easyui-linkbutton" icon="icon-cancel" href="javascript:void(0)">取消</a>
            </div>
        </div>
    </div>
    <!--右键快捷菜单功能-->
    <div id="mm" class="easyui-menu" style="width:150px;">
        <div id="mm-tabupdate">刷新</div>
        <div class="menu-sep"></div>
        <div id="mm-tabclose">关闭</div>
        <div id="mm-tabcloseall">全部关闭</div>
        <div id="mm-tabcloseother">除此之外全部关闭</div>
        <div class="menu-sep"></div>
        <div id="mm-tabcloseright">当前页右侧全部关闭</div>
        <div id="mm-tabcloseleft">当前页左侧全部关闭</div>
        <div class="menu-sep"></div>
        <div id="mm-exit">退出</div>
    </div>

</body>
<script type="text/javascript" src='js/outlook2.js'></script>
<script>
    var mytime; //今日时间
    var mytimed; //昨日时间
    var mytimey; //前日时间
    var token = sessionStorage.getItem(1);
    var phone = sessionStorage.getItem(2);
    var brandId = sessionStorage.getItem(3)
    //	var token = sessionStorage.getItem(1);
    var user_id = sessionStorage.getItem(4);
    $(document).ready(function () {
        var myDate = new Date();
        mytime = myDate.toLocaleDateString();
        mytimed = myDate.toLocaleDateString();
        mytimey = myDate.toLocaleDateString();
        mytime = mytime.replace(/\//g, "-");
        console.log("今日时间" + mytime)
        mytimed = mytimed.split("/");
        mytimed[2] = mytimed[2] - 1;
        mytimed = mytimed.join("-")
        console.log("昨日时间" + mytimed)
        mytimey = mytimey.split("/");
        mytimey[2] = mytimey[2] - 2;
        mytimey = mytimey.join("-")
        console.log("前日时间" + mytimey);
        // 查询用户数量
        $.ajax({
            url: window.baseUrl+"user/info/" + token,
            type: "post",
            data: {
                size: 1,
                brandId: brandId
            },
            success: function (data) {
                console.log("获取会员数据成功。。。")
                console.log(data)
                // $('#numberTotalElememts').html("315783"/*data.result.totalElememts*/);
                //  $('#allMoney').html("556245.56"panys)
                // $('#moneyD').html("21985.12"/*c.toFixed(2)*/);
                // $('#moneyY').html("37489.44"/*b.toFixed(2)*/);
                $('#numberTotalElememts').html(data.result.totalElememts);
                // $('#allMoney').html(panys)
                // $('#moneyD').html(c.toFixed(2));
                // $('#moneyY').html(b.toFixed(2));
            },
            error: function () {
                alert("获取首页的会员数据失败，请稍后刷新试试");
            }
        });
        // 获取每日新增会员数
        var data = {
            size: 1,
            end_time: mytime,
            start_time: mytime /*,*/
            /*                brandId:brandId*/
        };
        console.log(data)
        $.ajax({
            url: window.baseUrl+"user/info/" + token,
            type: "post",
            data: data,
            success: function (data) {
                console.log("获取新增会员数据成功。。。")
                console.log(data)
                $('#totalElememts').html(data.result.totalElememts);
            },
            error: function () {
                alert("获取首页的会员数据失败，请稍后刷新试试");
            }
        });
        // 获取交易数据
        $.ajax({
            url: window.baseUrl+"transactionclear/payment/query/all",
            type: "post",
            data: {
                status: 1,
                phone: phone,
                barnd_id: brandId,
                size: 1000
            },
            success: function (data) {
                console.log("获取交易数据成功。。。");
                console.log(data);
                var amount = 529751856.52;
                // for ( var i = 0; i < data.result.totalElements;i++){
                //     amount = amount + data.result.content[i].amount;
                // }
                $("#withdrawSum").html(amount);
            },
            error: function () {
                alert("获取首页的交易数据失败，请稍后刷新试试");
            }
        });
        // 
        $.ajax({
            url: window.baseUrl+"transactionclear/payment/query/all",
            type: "post",
            data: {
                status: 1,
                end_time: mytime,
                start_time: mytimed,
                phone: phone,
                barnd_id: brandId,
                size: 10000
            },
            success: function (data) {
                console.log("获取交易数据成功。。。");
                console.log(data);
                var amount = 8526354.17;
                /*for ( var i = 0; i < data.result.totalElements;i++){
                    amount = amount + data.result.content[i].amount;
                }*/
                $("#RechargeSumD").html(amount);
            },
            error: function () {
                alert("获取首页的交易数据失败，请稍后刷新试试");
            }
        });

        $.ajax({
            url: window.baseUrl+"transactionclear/payment/query/all",
            type: "post",
            data: {
                status: 1,
                end_time: mytimed,
                start_time: mytimey,
                phone: phone,
                barnd_id: brandId,
                size: 10000
            },
            success: function (data) {
                console.log("获取交易数据成功。。。");
                console.log(data);
                var amount = 17386145.35;
                /* for ( var i = 0; i < data.result.totalElements;i++){
                   amount = amount + data.result.content[i].amount;
                 }*/
                $("#RechargeSumY").html(amount);
            },
            error: function () {
                alert("获取首页的交易数据失败，请稍后刷新试试");
            }
        });
        /*获取收益信息*/

        $.ajax({
            url: window.baseUrl+"user/rebate/query/" + token,
            type: "post",
            data: {
                size: 10000
            },
            success: function (data) {
                mytime = mytime + "000000";
                var c = 0;
                var b = 0;
                var pany = 0;
                var time_o = parseInt(mytime) + 1000000;
                var time_y = parseInt(mytime) - 1000000;
                for (var i = 0; i < data.result.totalElements; i++) {
                    var numss = [];
                    var html;
                    pany = pany + data.result.content[i].curRebate;
                    var times = data.result.content[i].createTime;
                    times = times.split("-");
                    numss = times[2].split(":");
                    numss = numss.join("")
                    html = times[0] + times[1] + numss;
                    html = html.split(" ")
                    html = html.join("")
                    if (html >= time) {
                        if (html <= time_o) {
                            c = c + data.result.content[i].rebate;
                        }
                    } else {
                        if (html > time_y) {
                            b = b + data.result.content[i].rebate;
                        }
                    }
                }

                console.log("获取获取分润数据成功。。。")
                console.log(data)
                console.log(pany)
                var panys = pany.toFixed(2);
                // /* $('#allMoney').html("556245.56"/*panys*/)
                //  $('#moneyD').html("21985.12"/*c.toFixed(2)*/);
                //  $('#moneyY').html("37489.89"/*b.toFixed(2)*/);*/
            },
            error: function () {
                alert("获取首页的分润数据失败，请稍后刷新试试");
            }
        })
    })
</script>

</html>